﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Profile;

namespace WebSite.admin.system
{
    public partial class captcha_manage : System.Web.UI.Page
    {


        // Methods
        private void Bind()
        {
            string sql = "select * from DB_Shopvode where vodeid=1";
            DataTable table = new DataTable();
            table = SQLAccess.GreatDs(sql).Tables[0];
            if (table.Rows.Count > 0)
            {
                this.vodewidth.Value = table.Rows[0]["vodewidth"].ToString();
                this.vodeheight.Value = table.Rows[0]["vodeheight"].ToString();
                this.vodename1.Checked = (bool)table.Rows[0]["vodename1"];
                this.vodename2.Checked = (bool)table.Rows[0]["vodename2"];
                this.vodename3.Checked = (bool)table.Rows[0]["vodename3"];
                this.vodename4.Checked = (bool)table.Rows[0]["vodename4"];
                this.isvode.SelectedValue = table.Rows[0]["isvode"].ToString();
            }
        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            SQLAccess.DoSql(string.Concat(new object[] { "update DB_Shopvode set vodename1=", this.vodename1.Checked ? "1" : "0", ",vodename2=", this.vodename2.Checked, ",vodename3=", this.vodename3.Checked, ",vodename4=", this.vodename4.Checked, ",isvode=", re.replace(this.isvode.SelectedValue), ",vodewidth=", re.replace(this.vodewidth.Value), ",vodeheight=", re.replace(this.vodeheight.Value), " where vodeid=1" }));
            base.Response.Write("<script language='javascript'>window.location.href='captcha_manage.aspx';</script>");
            base.Response.End();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                this.Bind();
            }
        }

    }
}